import * as THREE from "three";
import imgYouzi from "./imgs/youzi.png";

function runPoints(scene: THREE.Scene) {
  const map = new THREE.TextureLoader().load(imgYouzi);
  // let geometry = new THREE.sprir(10, 10, 10);
  let material = new THREE.SpriteMaterial({ color: 0xff0000, map });

  const total: number = 100;
  const r: number = 20;
  const group: THREE.Group = new THREE.Group();
  for (let i = 0; i < total; i++) {
    const sp = new THREE.Sprite(material);
    sp.position.x = Math.sin(((2 * Math.PI) / total) * i) * r;
    sp.position.y = Math.cos(((2 * Math.PI) / total) * i) * r;
    sp.scale.set(2, 2, 2);
    // group.add(sp);
    console.log(i, sp.position);
    scene.add(sp);
  }

  scene.add(group);
}

export default runPoints;
